Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide AppGroup directory as location for iOS #75

Open
wants to merge 10 commits into
base: cordova-sqlite-ext-2.x
Choose a base branch
from

Conversation

be-ndee
Copy link

@be-ndee be-ndee commented Jan 13, 2018

This changes provide a new iOS Location called "Shared" which uses the AppGroup-ID to access a shared directory. If you set the iosDatabaseLocation to Shared and you set the preference SqliteExtAppGroupId in the config.xml to your AppGroup-ID, than the database can be used in the shared directory for your AppGroup.

I have to admit, that this is a very "fast" and simple way of adding this functionality, so I'm not sure if it's the right way. But it's working for me and I need it in a project.

@brodycj
Copy link
Owner

brodycj commented Jan 14, 2018

Thanks @be-ndee for the nice contribution. In general I like the way this enhancement was coded.

That said, I would probably rework it in one of the following ways:

  • shared group ID as an option in the openDatabase call, which would be given instead of location or iosDatabaseLocation
  • iOS database directory URL in openDatabase call, directory URL would come from another plugin

For the second alternative there should probably be another plugin to lookup the directory path URL, based on the shared group ID.

@brodycj
Copy link
Owner

brodycj commented Jan 14, 2018

P.S. Some alternatives how to get Cordova app preferences from config.xml now tracked in brodycj/cordova-notes#2

Alternatives so far:

@be-ndee
Copy link
Author

be-ndee commented Jan 16, 2018

I've added some changes. I removed the "Shared" location and provided a new option called iosDirectoryURL where you can set the directory used in iOS. In the Objective-C code, the iosDirectoryURL and dbName are concatenated.

@brodycj
Copy link
Owner

brodycj commented Jan 17, 2018

Thanks @be-ndee for what looks like a wonderful contribution. I will probably need 1-2 weeks to test and integrate due to some other, pressing issues.

@be-ndee
Copy link
Author

be-ndee commented Feb 8, 2018

@brodybits what's the current progress of this pr?

@brodycj
Copy link
Owner

brodycj commented Feb 8, 2018

It may be another 1-2 months due to some client support needs and other pressing issues. My apologies.

@brodycj
Copy link
Owner

brodycj commented Feb 8, 2018

Please feel free to maintain and publish your own fork until I get a chance to deal with this one. I will likely support the arbitrary database location for all 3 mobile platforms Android/iOS/Windows at the same time, in a new major release.

@be-ndee
Copy link
Author

be-ndee commented Feb 8, 2018

Thanks for the fast reply, you don't need to apologize. Just wanted to know, what's up at the moment ;)

Good idea to do it in a major release, which is more tested and not a fast-fix, like I did it ;)

Thank you anyway! :)

@brodycj brodycj changed the base branch from cordova-sqlite-ext-master to cordova-sqlite-ext-2.x February 14, 2019 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants